Imports System
Imports System.Text
Imports System.Runtime.InteropServices
Imports System.Exception
Imports System.Management
Imports System.Security.Cryptography
Imports System.Web

''' -----------------------------------------------------------------------------
''' Project	 : CommonObjects
''' Class	 : itoknet.CommonObjects.HardwareID
''' 
''' -----------------------------------------------------------------------------
''' <summary>
''' Generate a unique hash for a system which does not require administrative permissions
''' (can run from ASPNet process)
''' </summary>
''' <remarks>
''' </remarks>
''' <history>
''' 	[cinj]	24/09/2004	Created
''' </history>
''' -----------------------------------------------------------------------------
Public Class HardwareID
    Public Shared ReadOnly Property SystemHash() As String
        Get
            Dim SHA As New SHA1Managed
            Return HttpUtility.UrlEncode(Convert.ToBase64String(SHA.ComputeHash(ASCIIEncoding.ASCII.GetBytes(System.Environment.MachineName)))).Replace("%", "")
        End Get
    End Property
End Class
